<HTML><HEAD><TITLE>/home/steder/Projects/Tutorials/python/BobChat-v0.3/BobClient.py</TITLE></HEAD>
                  <BODY BGCOLOR=#FFFFFF>
                  <!--header-->
                  <!--script--><PRE><FONT COLOR=#3333CC><B>import</B></FONT> time
<FONT COLOR=#3333CC><B>import</B></FONT> string
<FONT COLOR=#3333CC><B>import</B></FONT> random

<FONT COLOR=#1111CC># PyGame Constants</FONT>
<FONT COLOR=#3333CC><B>import</B></FONT> pygame
<FONT COLOR=#3333CC><B>from</B></FONT> pygame.locals <FONT COLOR=#3333CC><B>import</B></FONT> *
<FONT COLOR=#3333CC><B>from</B></FONT> pygame.color <FONT COLOR=#3333CC><B>import</B></FONT> THECOLORS

<FONT COLOR=#3333CC><B>import</B></FONT> box

<FONT COLOR=#3333CC><B>def</B></FONT><A NAME="main"><FONT COLOR=#CC0000><B> main</B></FONT></A>():
    WINSIZE = 640,480
    pygame.init()
    screen = pygame.display.set_mode(WINSIZE,0,8)
    pygame.display.set_caption(<FONT COLOR=#115511>'Bouncing Baby Boxes!'</FONT>)
    
    screen.fill(THECOLORS[<FONT COLOR=#115511>"black"</FONT>])
    
    box1 = box.Box( screen, (32,32), (1,1), THECOLORS[<FONT COLOR=#115511>"black"</FONT>], THECOLORS[<FONT COLOR=#115511>"white"</FONT>] )
    box2 = box.Box( screen, (32,32), (-1,-1), THECOLORS[<FONT COLOR=#115511>"black"</FONT>], THECOLORS[<FONT COLOR=#115511>"red"</FONT>])
    box3 = box.Box( screen, (32,32), (1, 4), THECOLORS[<FONT COLOR=#115511>"black"</FONT>], THECOLORS[<FONT COLOR=#115511>"green"</FONT>])
    <FONT COLOR=#1111CC># The Main Event Loop</FONT>
    done = False
    <FONT COLOR=#3333CC><B>while</B></FONT> <FONT COLOR=#3333CC><B>not</B></FONT> done:
        <FONT COLOR=#1111CC># Drawing:</FONT>
        box1.draw()
        box2.draw()
        box3.draw()
        <FONT COLOR=#1111CC># Drawing finished this iteration?  Update the screen</FONT>
        pygame.display.update()
            
        <FONT COLOR=#1111CC># Event Handling:</FONT>
        events = pygame.event.get( )
        <FONT COLOR=#3333CC><B>for</B></FONT> e <FONT COLOR=#3333CC><B>in</B></FONT> events:
            <FONT COLOR=#3333CC><B>if</B></FONT>( e.type == QUIT ):
                done = True
                <FONT COLOR=#3333CC><B>break</B></FONT>
            <FONT COLOR=#3333CC><B>elif</B></FONT> (e.type == KEYDOWN):
                <FONT COLOR=#3333CC><B>if</B></FONT>( e.key == K_ESCAPE ):
                    done = True
                    <FONT COLOR=#3333CC><B>break</B></FONT>
                <FONT COLOR=#3333CC><B>if</B></FONT>( e.key == K_f ):
                    pygame.display.toggle_fullscreen()

    <FONT COLOR=#3333CC><B>print</B></FONT> <FONT COLOR=#115511>"Exiting!"</FONT>

    <FONT COLOR=#3333CC><B>return</B></FONT>
<FONT COLOR=#3333CC><B>if</B></FONT> __name__==<FONT COLOR=#115511>"__main__"</FONT>:
    main()
    
</PRE>
                  <!--footer-->
                  </BODY>
